home *** CD-ROM | disk | FTP | other *** search
- #include<stdio.h>
-
- main(int argc,char *argv[])
- {
- FILE *fin,*fout;
- char s[256];
-
- if(argc!=3){
- printf("NetCock用チャットファイルフィルター v0.01\n");
- printf(" Copyright(c)1994 MASAYA FUJIMOTO all rights reserved.\n");
- printf("\n");
- printf(" 使い方:chatfil inputfile outputfile\n");
- printf("\n");
- exit(1);
- }
-
- if((fin=fopen(argv[1],"r"))==NULL){
- printf("入力ファイルが開けませんのら!\n");
- exit(1);
- }
-
- if((fout=fopen(argv[2],"w"))==NULL){
- printf("出力ファイルが開けませんのら!\n");
- exit(1);
- }
-
-
- printf("NetCock用チャットファイルフィルター v0.01\n");
- printf(" Copyright(c)1994 MASAYA FUJIMOTO all rights reserved.\n");
- printf("…ただいま処理中\n");
-
- while(fgets(s,256,fin)!=NULL){
- if(s[0]=='('){
- if(fputs(s,fout)==EOF){
- printf("出力エラー発生");
- fclose(fout);
- fclose(fin);
- exit(1);
- }
- if(fputs("\n",fout)==EOF){
- printf("出力エラー発生");
- fclose(fout);
- fclose(fin);
- exit(1);
- }
- }
- }
- fclose(fout);
- fclose(fin);
- printf("おしまい☆");
- }
-